<?php 

/**
 * NOTICE OF LICENSE
 *
 * THIS SOURCE FILE IS PART OF EVEBIT'S PRIVATE PROJECT.
 * 
 * DO NOT USE THIS FILE IN OTHER PLACE.
 *
 * @package     App_Backend
 * @subpackage  View
 * @author      Cheng Wei <berlios.o@gmail.com>
 * @version     $$Id: massaction.phtml 20 2010-12-18 09:35:07Z cheng.wei $$
 */
?>
<?php if($this->showmassactions || $this->showmassactions === NULL):?>

<table cellspacing="0" cellpadding="0" >					
	<tr>
	   <td>
        	
                    	<?php if(isset($this->massactions['options']) && count($this->massactions['options']) > 0):?>
                        <span class="field-row">
                        <label> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </label>
                            <select class="required-entry select absolute-advice" name="grid_action" id="grid_action" >
                            	<option value="">&nbsp;</option>
                            	<?php foreach ($this->massactions['options'] as $option):?>
                            			<option <?php echo @$option['default']?'selected="selected"':'' ?> value="<?php echo @$option["value"] ?>">
                            				<?php echo @$option["title"] ?>
                            			</option>
                            	<?php endforeach;?>                            	
                            </select>
                        </span>
                        <?php endif;?>
                        <div  class="meta mass"-->
                        	<?php if (@$this->massactions['options']):?>
<!--                            <button onclick="" -->
<!--                            	class="scalable" type="button" >-->
<!--                            	<span></span>-->
<!--                            </button>-->
                            
                  		 <ul>
                  		 <li>
            	<a onclick="submitAction()" title="<?php echo $this->__("Submit") ?>" class="tooltip">
            		<span class="ui-icon ui-icon-power"></span>
            		<?php echo $this->__("Submit") ?>
            		</a>
           			 </li>
           			 </ul>
            		
                            <?php endif;?>
                        </div>                       
                    				               
	            
    	</td>
	</tr>					
</table>
<?php endif;?>
<script type="text/javascript">
function submitAction(){
	if(document.getElementById('grid_action').value=='delete' || document.getElementById('grid_action').value=='task/delete'){
		if(!window.confirm('<?php echo $this->__("Delete the selected record") ?>')){
			return false;
			}
		};
	document.getElementById('<?php echo $this->massactions['grid_id'] ?>_form').action+='/'+document.getElementById('grid_action').value;
	document.getElementById('<?php echo $this->massactions['grid_id'] ?>_form').submit();
}


</script>